package com.gp.learn.ssm.base.system.service;

import com.gp.learn.ssm.base.core.mybaits.base.service.IBaseService;
import com.gp.learn.ssm.base.core.security.model.OpenAuthority;
import com.gp.learn.ssm.base.system.entity.BaseAuthority;

import java.util.List;

/**
 * 系统权限-菜单权限、操作权限、API权限 服务类
 * @author gp
 * @since 2020-08-07
 */
public interface BaseAuthorityService extends IBaseService<BaseAuthority> {

    /**
     * 获取所有可用权限
     *
     * @param type = null 查询全部  type = 1 获取菜单和操作 type = 2 获取API
     * @return
     */
    List<OpenAuthority> findAuthorityByType(String type);

    /**
     * 获取角色已授权权限
     *
     * @param roleId
     * @return
     */
    List<OpenAuthority> findAuthorityByRole(Long roleId);

    /**
     * 获取权限
     * @param userId
     * @param isSuper
     * @return
     */
    List<OpenAuthority> findAuthorityByUser(Long userId, boolean isSuper);


}
